home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Linux Cubed Series 7: Sunsite
/
Linux Cubed Series 7 - Sunsite Vol 1.iso
/
system
/
serial
/
callback.001
/
callback~
/
callback
/
lib
/
dbase
/
tellstate.c
< prev
next >
Wrap
C/C++ Source or Header
|
1996-07-30
|
946b
|
37 lines
#include "dbase.p"
void tellstate(char *line)
{
int
uid,
state;
printf("Callback state %s: ", line);
if (!access(filename[the_statefile], R_OK)) /* statefile exists ? */
{
switch (getstate(&state, &uid))
{
case -2:
printf(" callback expired: ");
/* FALLING THROUGH */
case -1:
case 0:
printf(" ready for incoming call.\n");
break;
default:
printf(" calling %s (attempt %d).\n",
username(uid),
get_ntries() + 1 - state);
}
} /* disablefile exists ? */
else if (!access(filename[the_disablefile], R_OK))
printf(" incoming calls disabled.\n");
else
printf(" ready for incoming calls.\n");
}